package com.tuozixuan.camel.setproperty;

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

@Component
public class SetPropertyDemoRoute extends RouteBuilder {

	@Override
	public void configure() {
	    // 设置一个myBody属性，值为消息体内容
        //from("timer:firedOnceTimer?repeatCount=1").setBody().constant("Set Body").setProperty("myBody", body()).to("log:hello");
        
        // 设置一个myBody1属性，值为已经存在的另一个属性的值
//        from("timer:firedOnceTimer?repeatCount=1").setBody().constant("Set Body")
//        .setProperty("myBody", body())
//        .setProperty("myBody1", exchangeProperty("myBody"))
//        .to("log:hello");
	}

}
